package com.ruoyi.hospital.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.hospital.domain.YlArea;
import com.ruoyi.hospital.mapper.YlAreaMapper;
import com.ruoyi.hospital.service.IYlAreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 院区信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-02-16
 */
@Service
public class YlAreaServiceImpl implements IYlAreaService
{
    @Autowired
    private YlAreaMapper ylAreaMapper;

    /**
     * 查询院区信息
     * 
     * @param areaId 院区信息主键
     * @return 院区信息
     */
    @Override
    public YlArea selectYlAreaByAreaId(Long areaId)
    {
        return ylAreaMapper.selectYlAreaByAreaId(areaId);
    }

    @Override
    public List<YlArea> selectAll() {
        return ylAreaMapper.selectAll();
    }

    /**
     * 查询院区信息列表
     * 
     * @param ylArea 院区信息
     * @return 院区信息
     */
    @Override
    public List<YlArea> selectYlAreaList(YlArea ylArea)
    {
        return ylAreaMapper.selectYlAreaList(ylArea);
    }

    /**
     * 新增院区信息
     * 
     * @param ylArea 院区信息
     * @return 结果
     */
    @Override
    public int insertYlArea(YlArea ylArea)
    {
        ylArea.setCreateTime(DateUtils.getNowDate());
        return ylAreaMapper.insertYlArea(ylArea);
    }

    /**
     * 修改院区信息
     * 
     * @param ylArea 院区信息
     * @return 结果
     */
    @Override
    public int updateYlArea(YlArea ylArea)
    {
        ylArea.setUpdateTime(DateUtils.getNowDate());
        return ylAreaMapper.updateYlArea(ylArea);
    }

    /**
     * 批量删除院区信息
     * 
     * @param areaIds 需要删除的院区信息主键
     * @return 结果
     */
    @Override
    public int deleteYlAreaByAreaIds(Long[] areaIds)
    {
        return ylAreaMapper.deleteYlAreaByAreaIds(areaIds);
    }

    /**
     * 删除院区信息信息
     * 
     * @param areaId 院区信息主键
     * @return 结果
     */
    @Override
    public int deleteYlAreaByAreaId(Long areaId)
    {
        return ylAreaMapper.deleteYlAreaByAreaId(areaId);
    }
}
